import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolDemo8 {
    public static void main(String[] args) {
        //根据当前设备的配置自动生成线程池
        ExecutorService service = Executors.newWorkStealingPool();

        for (int i = 0; i < 100; i++) {
            service.submit(() -> {
                System.out.println("线程名" + Thread.currentThread().getName());
            });
        }
        while (!service.isTerminated()) {
        }
    }
}
